Preheat oven to 350 degrees. Spray a 9X13-inch pan with cooking spray with flour.
Using an electric mixer, beat butter and sugar until fluffy. Add the 4 eggs one at a time, stopping to scrape down the sides of the bowl several times.
Beat in vanilla extract.
Sift together cake flour, unsweetened cocoa, baking soda, and salt onto a piece of parchment paper.
Add flour mixture to butter mixture alternating with buttermilk, beginning and ending with flour mixture. Beat just until combined.
Stir in food coloring and pour batter into prepared pan. Bake for 35-40 minutes, or until a wooden pick inserted in center comes out clean.
Let cool before frosting.
To make frosting, stir together cream, sugar, egg yolks, and butter in a medium saucepan. Cook over medium heat until mixture is thick enough to coat the back of a spoon. Stir frequently. Add coconut and pecans. Let cool 15-20 minutes before pouring frosting on cake.